#include <iostream>

using namespace std;

int a[100000];
bool error = false, w[100000], s[100000];

int leftchild( int n )
{
    return 2 * n + 1;
}

int rightchild( int n )
{
    return 2 * n + 2;
}

void treeset( int n )
{
    if ( w[ n ] == false ) error = true;
    if ( s[ leftchild( n ) ] ) treeset ( 2 * n + 1 );
    if ( s[ rightchild( n ) ] ) treeset ( 2 * n + 2 );
}

int main()
{
    memset(a, -1, sizeof( a ));
    memset(w, false, sizeof( w ));
    memset(s, false, sizeof( s ));
    char data[1000];
    while ( cin >> data )
    {
        int i, v;
        if ( data[ 0 ] == '(' && data[ 1 ] == ')' )
        {
            treeset( 0 );
            if ( error ) cout << "not complete" << endl;
            else
            {
                cout << a[ 0 ];
                for ( i = 1; i < 100000; i++ )
                    if ( s[ i ] )
                        cout << ' ' << a[ i ];
                cout << endl;
            }
            error = false;
            memset(a, -1, sizeof( a ));
            memset(w, false, sizeof( w ));
            memset(s, false, sizeof( s ));
        }
        else
        {
            for ( i = 0; i < strlen( data ); i++ )
            {
                if ( data[ i ] == '(' )
                {
                    i++; v = 0;
                    while ( data[ i ] != ',' )
                    {
                        v = v * 10 + data[ i ] - '0';
                        i++;
                    }
                    i++;
                    int t = 0;
                    if ( data [ i ] == ')')
                    {
                        a[ 0 ] = v;
                        s[ 0 ] = true;
                        w[ 0 ] = true;
                    }
                    else
                    {
                        while ( data[ i ] != ')' )
                        {
                            if ( data[ i ] == 'L' )
                            {
                                if ( s[ leftchild( t ) ] == false )
                                    s[ leftchild( t ) ] = true;
                                t = leftchild( t );
                            }
                            if ( data[ i ] == 'R' )
                            {
                                if ( s[ rightchild( t ) ] == false )
                                    s[ rightchild( t ) ] = true;
                                t = rightchild( t );
                            }
                            i++;
                        }
                        if ( w[ t ] == true ) error = true;
                        w[ t ] = true;
                        a[ t ] = v;
                    }
                }
            }
        }
    }
    return 0;
}
